#include"comman.hpp"
int main()
{
    // key_t k = getkey();
    // cout<<k<<endl;
//     int shmid = create(k);//打开共享内存
//     cout<<shmid<<endl;
//    char * address = (char *) shmat(shmid,nullptr,0);//建立链接
//    cout<<address<<endl;
//    sleep(5);
//     shmdt(address);
        int shmid = getshmid();
        char * address = (char *) shmat(shmid,nullptr,0);//建立链接
        while(true)
   {
     fgets(address,size,stdin);
   }
        //  sleep(10);
        shmdt(address);//取消链接
        shmctl(shmid,IPC_RMID,nullptr);
}